package com.qst.rongxiaoserver.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qst.rongxiaoserver.mapper.FinanceMapper;
import com.qst.rongxiaoserver.model.FinanceModel;
import com.qst.rongxiaoserver.service.IFinanceService;
import org.springframework.stereotype.Service;

@Service
public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, FinanceModel> implements IFinanceService {

    @Override
    public Page<FinanceModel> getFinanceList(int pageNum, int pageSize, String realName) {
        // 分页查询
        Page<FinanceModel> page1 = new Page<>(pageNum, pageSize);

        // 查询条件
        LambdaQueryWrapper<FinanceModel> queryWrapper = new LambdaQueryWrapper<>();
        if(realName!=null && !realName.isEmpty()){
            queryWrapper.like(FinanceModel::getRealName,realName);   // 模糊查询
        }

        return this.page(page1, queryWrapper);
    }
}